/**
 * 需要配置下面这个定义才能使用这个文件
 * declare const __UNI_PLATFORM__:
 *   | 'h5'
 *   | 'app'
 *   | 'mp-alipay'
 *   | 'mp-baidu'
 *   | 'mp-jd'
 *   | 'mp-kuaishou'
 *   | 'mp-lark'
 *   | 'mp-qq'
 *   | 'mp-toutiao'
 *   | 'mp-weixin'
 *   | 'quickapp-webview'
 *   | 'quickapp-webview-huawei'
 *   | 'quickapp-webview-union'
 */

export const platform = __UNI_PLATFORM__
export const isH5 = __UNI_PLATFORM__ === 'h5'
export const isApp = __UNI_PLATFORM__ === 'app'
export const isMp = __UNI_PLATFORM__.startsWith('mp-')
export const isMpWeixin = __UNI_PLATFORM__.startsWith('mp-weixin')
export const isMpAplipay = __UNI_PLATFORM__.startsWith('mp-alipay')
export const isMpToutiao = __UNI_PLATFORM__.startsWith('mp-toutiao')

const PLATFORM = {
  platform,
  isH5,
  isApp,
  isMp,
  isMpWeixin,
  isMpAplipay,
  isMpToutiao,
}
export default PLATFORM
